 grammar{
 
 start = element-library
 
 element-library = element library {element-book +}
 
 element-book = element book {
     book-basic,
     book-extended
    }

 book-basic =
     attribute id { text },
     element-isbn,
     element-title,
     element-author+,
     element-character?
 
 book-extended = 
     attribute available { text },
     element-character*

 element-isbn = element isbn { text }
 
 element-title = element title {
     attribute xml:lang { text },
     text
    }
     
 element-author = element author {
     attribute id { text },
     element-name,
     element-born?,
     element-died?
    }
  
 element-name = element name { text }
 
 element-born = element born { text }
 
 element-died = element died { text }
 
 element-character = element character {
     attribute id { text },
     element-name,
     element-born?,
     element-qualification
    }
 
 element-qualification = element qualification { text }
 
 }
